using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Collections;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
namespace ePlanSysOman
{
  public partial class frmDetail
  {
      public static frmDetail newfrmDetail1 = new frmDetail();//JMR


    private void  // ERROR: Handles clauses are not supported in C#
frmType_Load(object sender, System.EventArgs e)
    {
      //Dim dc As New clsData
      //Dim ds As New DataSet

      //ds = dc.getData("select * from tblTypeVer where cid = " & CountryId)
      //GridControl1.DataSource = ds.Tables(0)
      //GridView1.Columns("cId").Visible = False
      //ds = dc.getData("select country from tblcountry where id = " & CountryId)
      //cname = ds.Tables(0).Rows(0)("COUNTRY")
      //Me.Text = cname

      GridControl1.Update();
      GridControl1.RefreshDataSource();
    }

    private void  // ERROR: Handles clauses are not supported in C#
txtSwire_TextChanged(System.Object sender, System.EventArgs e)
    {

    }

    private void  // ERROR: Handles clauses are not supported in C#
txtSwire_Validated(object sender, System.EventArgs e)
    {
      try {
        txtSwire.BackColor = Color.White;
      } catch (Exception ex) {

      }
      if (txtSwire.Text.Length == 2) {
        txtSwire.Text = "0" + txtSwire.Text;
      }
      DataSet dsas = new DataSet();
      clsData dc = new clsData();
      string TR;
      string tr2;
      if (ComboBoxEdit1.Text == "REMOVE") {
        tr2 = Module1.newModule.oldharn;
      } else if (ComboBoxEdit1.Text == "Revise From") {
        tr2 = Module1.newModule.oldharn;//JMR
      } else {
        tr2 = Module1.newModule.newharn;
      }
      TR = Module1.newModule.newharn.Substring(4, Module1.newModule.newharn.Length - Module1.newModule.newharn.IndexOf("-") + 2);//JMR
      txtSwire.Text = txtSwire.Text.Replace(TR, "");
      string fd;
      dsas = dc.getData("SELECT * FROM PTP2 WHERE part_number ='" + tr2 + "' and  WIRE_NUMBER LIKE '" + TR + txtSwire.Text + "%'");
      try {
        txtSrefd.Text = Conversions.ToString(dsas.Tables[0].Rows[0]["WIRE_END_REF"]);
        txtSwire.Text = Conversions.ToString(dsas.Tables[0].Rows[0]["WIRE_NUMBER"]);
        txtSpin.Text = Conversions.ToString(dsas.Tables[0].Rows[0]["WIRE_END_PIN"]);
        txtSterm.Text = Conversions.ToString(dsas.Tables[0].Rows[0]["WIRE_END_PN"]);
        txtSlength.Text = Conversions.ToString(dsas.Tables[0].Rows[0]["WIRE_LEN_MEAS"]);
        txtSend.Text = Conversions.ToString(dsas.Tables[0].Rows[0]["WIRE_END_CD"]);
        srefd2.Text = Conversions.ToString(dsas.Tables[0].Rows[1]["WIRE_END_REF"]);
        // swire2.Text = dsas.Tables(0).Rows(1).Item("WIRE_NUMBER")
        spin2.Text = Conversions.ToString(dsas.Tables[0].Rows[1]["WIRE_END_PIN"]);
        sterm2.Text = Conversions.ToString(dsas.Tables[0].Rows[1]["WIRE_END_PN"]);
        slength2.Text = Conversions.ToString(dsas.Tables[0].Rows[1]["WIRE_LEN_MEAS"]);
        send2.Text = Conversions.ToString(dsas.Tables[0].Rows[1]["WIRE_END_CD"]);
      } catch (Exception ex) {
        txtSpin.Text = "";
        txtSlength.Text = "";
        txtSend.Text = "";
        txtSterm.Text = "";
        txtSrefd.Text = "";
        spin2.Text = "";
        send2.Text = "";
        srefd2.Text = "";
        spin2.Text = "";
        slength2.Text = "";
      }
      // 
    }

    private void PanelControl1_Paint(object sender, PaintEventArgs e)
    {

    }

    private void GridControl4_Click(object sender, EventArgs e)
    {

    }

    private void GridControl1_Click(object sender, EventArgs e)
    {

    }

      public frmDetail()
    {
        InitializeComponent(); 
    }
  }
}

